#! /bin/bash

string="hello,my name is Junix."

#匹配字符串开头的子串长度
echo `expr match "$string" 'J.*x'`
echo `expr match "$string" 'h.*x'`
echo `expr "$string" : 'h.*' `

#index
echo `expr index "$string" 'unix'`
echo `expr index "$string" 'name'`

echo ${string:(-6)}
echo ${*:2}
echo ${@:2}
echo ${@:2:3} 
